<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

<head>
	<title>Spring Sample</title>
	<script type="text/javascript" src="script/jquery.js"></script>
	<script type="text/javascript" src="script/jquery.notice.js"></script>

	<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
	<h3>Content:</h3>
	<ul id="result"></ul>

	<script type="text/javascript">
	$(document).ready(function() {
	   	$.ajax({
  			type: 'GET',
  			dataType: 'json',
  			url: '/spring-sample/booksearch/books/',
  			beforeSend: function(req) { req.setRequestHeader('Accept', 'application/json');	},
			success: function(data) {
  				if (window.console) { console.dir(data); }

  				$.each(data['org.springframework.validation.BindingResult.books'], function(index, value) {
  					$('#result').append('<li>' + value.title + '</li>');
  				});

  				$.noticeAdd({
  					text: data['org.springframework.validation.BindingResult.books'].length + ' Books added',
  					stay: false,
  					type: 'success'
  				});

  			}
		});
	});
	</script>
</body>
</html>